using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;

namespace SIOGDE.AccesoDatos.Entidades
{
 public partial class DestinoAsignado
 {
     public DestinoAsignado()
     {
         Guid = System.Guid.NewGuid().ToString();
     }
     #region foreign Keys

     public virtual int GestionId_FK {get;set;}
     private Gestion GestionId_obj ;
     public virtual Gestion Gestion
      {
          get { return GestionId_obj; }
          set {
                GestionId_obj = value;
                if (GestionId_obj != null) GestionId_FK = GestionId_obj.Id; 
          }
      }

     public virtual int PersonaId_FK {get;set;}
     private Persona PersonaId_obj ;
     public virtual Persona Persona
      {
          get { return PersonaId_obj; }
          set {
                PersonaId_obj = value;
                if (PersonaId_obj != null) PersonaId_FK = PersonaId_obj.Id; 
          }
      }

     


     public virtual int RequerimientoConfigId_FK { get; set; }
     private RequerimientoConfig RequerimientoConfigId_obj;
     public virtual RequerimientoConfig RequerimientoConfig
     {
         get { return RequerimientoConfigId_obj; }
         set
         {
             RequerimientoConfigId_obj = value;
             if (RequerimientoConfigId_obj != null) RequerimientoConfigId_FK = RequerimientoConfigId_obj.Id;
         }
     }


     #endregion
     public virtual int   Id { get; set;}

     
     [StringLength(100, ErrorMessage = "{0} debe tener al menos {2} caracteres.", MinimumLength = 2)]
     [Display(Name = "Guid")]
     public virtual string   Guid { get; set;}

     
     [DataType(DataType.Date)]
     [Display(Name = "FechaRegistro")]
     public virtual DateTime   FechaRegistro { get; set;}

     
     //[DataType(DataType.Date)]
     [Display(Name = "FechaAsignacion")]
     [DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = "{0:dd/MM/yyyy}")]
     public virtual DateTime   FechaAsignacion { get; set;}
     //public virtual string FechaAsignacionString { get; set; }

     [StringLength(50, ErrorMessage = "{0} debe tener al menos {2} caracteres.", MinimumLength = 2)]
     [Display(Name = "RegistradoPor")]
     public virtual string   RegistradoPor { get; set;}

     [StringLength(200, ErrorMessage = "{0} debe tener al menos {2} caracteres.", MinimumLength = 2)]
     [Display(Name = "Observaciones")]
     public virtual string   Observaciones { get; set;}

     
     //[DataType(DataType.Date)]
     [Display(Name = "Desde")]
     [DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = "{0:dd/MM/yyyy}")]
     public virtual DateTime? FechaDesde { get; set; }

     [Required(ErrorMessage = "Fecha Hasta es Requerido")]
     //[DataType(DataType.Date)]
     [Display(Name = "Hasta")]
     [DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = "{0:dd/MM/yyyy}")]
     public virtual DateTime? FechaHasta { get; set; }

     [Display(Name = "Unidad Militar")]
     public virtual int? UnidadMilitarId { get; set; }
     [Display(Name = "Cargo Asignado")]
     public virtual int? TipoCargoComandoId { get; set; }
     [Display(Name = "Grado (no obligatorio)")]
     public virtual int? GradoId { get; set; }


     // public IList<EvaluacionDestino> Evaluaciones { get; set; }
     
     //no mapeado
     public string NombreCompletoPersona { get { return Persona.NombreCompleto; } }

 }
}

